<!--
 @Author: libing/makeup1122
 @Email: makeup1123@163.com
 @Date: "2020-04-03 20:39:46"
-->
<template>
  <v-container>
    <TreeSelect v-model="select" :items="items" label="test" :loading="loading"/>
  </v-container>
</template>
<script>
import { fetchTreeData } from '@/api/admin/category.js'
export default {
  name: 'DemoTreeSelect',
  components: {
    TreeSelect: () => import('@/components/Form/TreeSelect.vue')
  },
  data: function () {
    return {
      select: [],
      loading: false,
      items: []
    }
  },
  computed: {},
  created: function () {
    this.loading = true
    fetchTreeData().then(res => {
      this.items = res.data.map(e => {
        e.disabled = (e.status === 'disabled' || e.redirect === 'yes')
        return e
      })
    }).finally(() => {
      this.loading = false
    })
  },
  methods: {}
}
</script>
<style scoped>
</style>
